package fourzerofour.yangqiang.day01;

import com.sun.org.apache.xpath.internal.objects.XString;

import java.util.Scanner;

public class Question4 {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入需要计算的最大数");
        int n = scanner.nextInt();
        if (n % 2 != 1) {
            System.out.println("您输入的是偶数，无法计算");
            return;
        }
        int sum = 0;
        for (int i = 1; i <= n; i += 2) {
                sum += i;
        }
        String str = "1";
        for (int i = 3; i <= n; i += 2) {
                str = str + "+" + i;
        }
        System.out.println(str + "您的计算结果为：" + sum);
    }
}
